<?php defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH.'/libraries/REST_Controller.php';

class marketitem extends REST_Controller
{     
	function get_market_item_by_id_get()
	{
		if(!$this->get('market_item_id')) {
			$this->response(array('status'=>"false",
					'message' => 'market_item_id not provided'), 200);
		}
		$this->load->model('marketitemdao');
		$success = $this->marketitemdao->getbyid($this->get('market_item_id'));
		$this->response(array('marketitem'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}

	function get_market_items_get()
	{
		$this->load->model('marketitemdao');
		$success = $this->marketitemdao->get_all();
		$this->response(array('market items'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}	
}
?>